home *** CD-ROM | disk | FTP | other *** search
/ TeX 1995 July / TeX CD-ROM July 1995 (Disc 1)(Walnut Creek)(1995).ISO / macros / tip / newdef.tip < prev    next >
Text File  |  1993-09-15  |  2KB  |  44 lines

  1. % This macro source file is from the four volume series
  2. % "TeX in Practice" by Stephan von Bechtolsheim, published
  3. % 1993 by Springer-Verlag, New York.
  4. % Copyright 1993 Stephan von Bechtolsheim.
  5. % No warranty or liability is assumed.
  6. % This macro may be copied freely if no fees other than
  7. % media cost or shipping charges are charged and as long
  8. % as this copyright and the following source code itself
  9. % is not changed. Please see the series for further information.
  10. %
  11. % Version: 1.0
  12. % Date: May 1, 1993
  13. %
  14. %
  15. % This source code is documented in 21.5.7, p. III-175.
  16. % Original source in file "macros1.TEX", starting line 1292.
  17. \wlog{L: "newdef.tip" ["macros1.TEX," l. 1292, p. III-175]}%
  18. % This file DOES belong to format "texip."
  19. \catcode`\@ = 11
  20. \def\NewDef #1{%
  21.     \ifx #1\@UndefinedToken
  22.     \else
  23.         \errhelp = {\string\NewDef:
  24.             The name of the macro to be defined which you
  25.             provided is already in use. Use \show to find out
  26.             what the name is used for. The macro definition
  27.             will nevertheless be executed.}%
  28.         \errmessage{\string\NewDef: "\string#1" already defined.}%
  29.     \fi
  30.     \def #1%
  31. }
  32. \def\ReDef #1{%
  33.     \ifx #1\@UndefinedToken
  34.         \errhelp = {\string\ReDef:
  35.             The name of the macro to be redefined which you
  36.             provided has never been used before. The macro definition
  37.             will nevertheless be executed. }%
  38.         \errmessage{\string\ReDef: "\string#1" never defined
  39.             before.}%
  40.     \fi
  41.     \def #1%
  42. }
  43. \catcode`\@ = 12
  44.